MDEV-37098 Fix Spider test failures in network-less environments
authorOtto Kekäläinen <otto@debian.org>
Fri, 12 Dec 2025 08:53:33 +0000 (08:53 +0000)
committerOtto Kekäläinen <otto@debian.org>
Tue, 13 Jan 2026 19:03:57 +0000 (19:03 +0000)
When running tests in environments without a network interface (such as
containers with `--network=none`), Spider could not retrieve a hardware
address to generate a node ID. This triggered a warning in the server
log, causing MTR to fail the test due to unexpected output:

    [Warning] mariadbd: Can't get hardware address with error 2

Fix this by logging Spider hardware address errors to server log only.
This ensures the message is recorded in the server log for debugging but
does not pollute the client output.

It is questionable if this is a problem at all anyway, as when
`my_gethwaddr` fails, the code zeroes out the address buffer, resulting
in a `spider_unique_id` formatted like `-000000000000-PID-`, which is
valid.

Forwarded: https://github.com/MariaDB/server/pull/4479

Gbp-Pq: Name MDEV-37098-Spider-test-failures-in-network-less-environments.patch

storage/spider/spd_table.cc

index 9194b5de5896b325211252991e0339e22395d936..5fb15300696d47978ffcf3279b7c0a2b0f10bcf1 100644 (file)
@@ -6530,8 +6530,13 @@ int spider_db_init(
 
   if (my_gethwaddr((uchar *) addr))
   {
-    my_printf_error(ER_SPIDER_CANT_NUM, ER_SPIDER_CANT_STR1, MYF(ME_WARNING),
-      "get hardware address with error ", errno);
+    sql_print_information("Spider: Can't get hardware address with error %d", errno);
+    /*
+      If we can't get the hardware address, we zero it out.
+      The spider_unique_id will then look like: -000000000000-PID-
+      This is still unique enough per-process to detect self-loops within
+      the same server instance, which is the primary purpose.
+    */
     bzero(addr,6);
   }
   spider_unique_id.str = spider_unique_id_buf;